import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { gettime02 } from "../../api/index";


export const useCounterStore = defineStore('counter', () => {
  const count = ref(2)
  const doubleCount = computed(() => count.value * 2)
  function increment() {
    count.value++
  }

  return { count, doubleCount, increment }
})

export const useTimeStore = defineStore('time', () => {
  const tiem = new Date()
  let nickName =localStorage.getItem('NICK_NAME')
  let tiem02=gettime02(tiem);
  return { tiem02,nickName }
})
